from wormbane.model.armor import Armor
from wormbane.model.race import Race
from wormbane.model.weapon import Weapon
from wormbane.util.random_ import percent_chance

import random

class Hobbit(Race):
    size = 'small'
    color = 'green'
    health = 2

    @classmethod
    def create_equipment(cls):
        yield Weapon(kind = random.choice(('dagger', 'knife', 'short sword')))
        if percent_chance(10):
            yield Armor(kind = 'cloak', color = 'gray')
        if percent_chance(1):
            yield Armor(kind = 'shirt', material = 'mithril')
